<template>
  <div class="box">
    <div class="f1">
      <div class="f1_content">
        <div class="goHome" @click="goHome">
          <img src="@/assets/flow/首页.png" alt="" />返回主页
        </div>
        <ul>
          <li v-for="(item, index) in list" :key="item.num">
            <h6>
              <span>{{ item.num }} </span>{{ item.str }}
            </h6>
            <template
              v-if="
                item.num == '01' ||
                item.num == '02' ||
                item.num == '03' ||
                item.num == '04' ||
                item.num == '05'
              "
            >
              <img class="quan" src="@/assets/home/组75.png" alt="" />
              <img class="line" src="@/assets/home/组73.png" alt="" />
            </template>
            <template v-else>
              <template v-if="item.num == '06'">
                <img class="quan" src="@/assets/home/组71.png" alt="" />
                <!-- <img class="line" src="@/assets/home/组72.png" alt="" /> -->
              </template>
              <template v-else>
                <img class="quan" src="@/assets/home/组71-2.png" alt="" />
                <img
                  class="line"
                  v-show="index !== list.length - 1"
                  src="@/assets/home/组74.png"
                  alt=""
                />
              </template>
            </template>
          </li>
        </ul>
      </div>
    </div>
    <div class="f2" v-loading="loading">
      <div class="content">
        <div class="title">
          <h6></h6>
          认证信息预览
        </div>
        <div class="content1">
          <div class="title">
            <h6></h6>
            企业信息
          </div>
          <!-- 表单 -->
          <el-form
            :model="ruleForm"
            ref="ruleForm"
            label-width="200px"
            class="demo-ruleForm"
          >
            <el-form-item label="企业名称">
              <el-input disabled v-model="ruleForm.entname"></el-input>
            </el-form-item>
            <el-form-item label="统一社会信用代码">
              <el-input disabled v-model="ruleForm.creditno"></el-input>
            </el-form-item>
            <el-form-item label="注册省份">
              <el-input disabled v-model="ruleForm.prov"></el-input>
            </el-form-item>
            <el-form-item class="aaaa" label="实缴资本">
              <el-input
                style="width: 355px"
                disabled
                v-model="ruleForm.realcapital"
              >
                <span slot="append" style="margin-right: 15px">万元</span>
                <el-select
                  disabled
                  slot="append"
                  v-model="ruleForm.unit"
                  placeholder="请选择"
                >
                  <el-option label="人民币" value="人民币"></el-option>
                  <el-option label="美元" value="美元"></el-option>
                  <el-option label="欧元" value="欧元"></el-option>
                  <el-option label="英镑" value="英镑"></el-option>
                  <el-option label="日元" value="日元"></el-option>
                  <el-option label="港币" value="港币"></el-option>
                </el-select>
              </el-input>
            </el-form-item>
            <el-form-item label="公司介绍">
              <el-input
                rows="2"
                disabled
                type="textarea"
                v-model="ruleForm.introduction"
              ></el-input>
            </el-form-item>
          </el-form>
          <!-- 营业执照 -->
          <div class="license" style="margin-top: 35px">
            <div class="titles" style="width: 140px">营业执照</div>
            <h5
              style="width: 240px; height: 150px; margin-right: 8px"
              v-viewer
              v-if="yyzz"
            >
              <img style="width: 237px" :src="yyzz" alt="" />
            </h5>
            <h5 class="titles" v-else>暂无</h5>
          </div>
          <!-- 企业图标 -->
          <div class="license" style="margin-top: 35px">
            <div class="titles" style="width: 140px">企业图标</div>
            <h5
              style="width: 240px; height: 150px; margin-right: 8px"
              v-viewer
              v-if="qytb"
            >
              <img :src="qytb" alt="" style="width: 100%; height: 100%" />
            </h5>
            <h5 class="titles" v-else>暂无</h5>
          </div>
          <!-- 组织架构图-->
          <div class="license" style="margin-top: 35px">
            <div class="titles" style="width: 140px">组织架构图</div>
            <h5
              style="width: 240px; height: 150px; margin-right: 8px"
              v-viewer
              v-if="zzjgt"
            >
              <img :src="zzjgt" alt="" style="width: 100%; height: 100%" />
            </h5>
            <h5 class="titles" v-else>暂无</h5>
          </div>
          <!-- 办公环境照片-->
          <div class="license" style="margin-top: 35px; margin-left: 70px">
            <div class="titles" style="width: 150px">办公环境照片</div>
            <h5
              v-viewer
              style="
                width: 100%;
                margin-right: 8px;
                display: flex;
                flex-wrap: wrap;
              "
              v-if="bghjzp"
            >
              <img
                :src="item"
                alt=""
                style="
                  width: 240px;
                  height: 150px;
                  margin-bottom: 8px;
                  margin-right: 15px;
                "
                v-for="item in bghjzp"
                :key="item"
              />
            </h5>
            <h5 class="titles" v-else>暂无</h5>
          </div>
          <div class="title">
            <h6></h6>
            法定代表人信息
          </div>
          <!-- 表单 -->
          <el-form
            :model="ruleForm"
            ref="ruleForm"
            label-width="200px"
            class="demo-ruleForm"
          >
            <el-form-item label="法定代表人姓名">
              <el-input disabled v-model="ruleForm.legalname"></el-input>
            </el-form-item>
            <el-form-item label="法定代表人手机号">
              <el-input disabled v-model="ruleForm.legalphone"></el-input>
            </el-form-item>
            <el-form-item label="法定代表人证件类型">
              <el-radio-group disabled v-model="ruleForm.legalcredentialtype">
                <el-radio label="身份证"></el-radio>
                <el-radio label="护照"></el-radio>
              </el-radio-group>
            </el-form-item>
            <el-form-item label="法定代表人证件号码">
              <el-input
                disabled
                v-model="ruleForm.legalcredentialnumber"
              ></el-input>
            </el-form-item>
          </el-form>
          <!-- 身份正反面-->
          <div
            class="license"
            style="margin-top: 35px; margin-left: 70px"
            v-if="frzm && frfm"
          >
            <div class="titles" style="width: 150px">证件上传</div>
            <h5
              style="
                width: 100%;
                margin-right: 8px;
                display: flex;
                flex-wrap: wrap;
              "
              v-viewer
            >
              <img
                :src="frzm"
                alt=""
                style="
                  width: 240px;
                  height: 150px;
                  margin-right: 15px;
                  margin-bottom: 8px;
                "
              />
              <img
                :src="frfm"
                alt=""
                style="
                  width: 240px;
                  height: 150px;
                  margin-left: 15px;
                  margin-bottom: 8px;
                "
              />
            </h5>
          </div>

          <div class="title">
            <h6></h6>
            业务相关行政许可信息
          </div>
          <!-- 表单 -->
          <el-form
            :model="ruleForm"
            ref="ruleForm"
            label-width="200px"
            class="demo-ruleForm"
          >
            <el-form-item label="是否有相关行政许可">
              <el-radio-group disabled v-model="ruleForm.adminlicense">
                <el-radio label="是" value="true"></el-radio>
                <el-radio label="否" value="false"></el-radio>
              </el-radio-group>
            </el-form-item>
            <el-form-item
              label="行政许可名称"
              v-if="ruleForm.adminlicense == '是'"
            >
              <el-input disabled v-model="ruleForm.adminlicensename"></el-input>
            </el-form-item>
            <el-form-item
              label="行政许可决定书文编号"
              v-if="ruleForm.adminlicense == '是'"
            >
              <el-input
                disabled
                v-model="ruleForm.adminlicensenumber"
              ></el-input>
            </el-form-item>
            <el-form-item label="有效期至" v-if="ruleForm.adminlicense == '是'">
              <el-input disabled v-model="ruleForm.effectiveuntil"> </el-input>
            </el-form-item>
          </el-form>
          <!-- 证书文件-->
          <div
            class="license"
            style="margin-top: 35px; margin-left: 0.3646x"
            v-if="ruleForm.adminlicense == '是'"
          >
            <div class="titles" style="width: 167px">证书文件</div>
            <h5 style="width: 100%; margin-right: 8px" v-viewer v-if="zjwj">
              <img
                :src="zjwj"
                alt=""
                style="width: 240px; height: 150px; margin-bottom: 8px"
              />
            </h5>
            <h5 class="titles" v-else>暂无</h5>
          </div>
          <!-- 专利信息 -->
          <div class="title">
            <h6></h6>
            专利信息
          </div>

          <el-table
            :data="zlxx"
            border
            style="width: 800px"
            stripe
            :header-cell-style="{
              background: '#F1F5FF',
              color: '#4D4D4D',
            }"
          >
            <el-table-column prop="" label="序号" min-width="8%" align="center">
              <template slot-scope="scope">
                <span>{{ scope.$index + 1 }}</span>
              </template>
            </el-table-column>
            <el-table-column
              prop="oldfilename"
              label="文件名称"
              align="center"
              min-width="50%"
            >
            </el-table-column>
            <el-table-column label="操作" align="center" min-width="10%">
              <template slot-scope="scope">
                <span class="span" @click="examine(scope.$index, zlxx)"
                  >查看</span
                >
              </template>
            </el-table-column>
          </el-table>
          <!-- </div>
          <h5 class="titlessss" v-else>暂无</h5> -->
          <!-- 商标信息 -->
          <div class="title">
            <h6></h6>
            商标信息
          </div>

          <el-table
            :data="spxx"
            border
            style="width: 800px"
            stripe
            :header-cell-style="{
              background: '#F1F5FF',
              color: '#4D4D4D',
            }"
          >
            <el-table-column prop="" label="序号" min-width="8%" align="center">
              <template slot-scope="scope">
                <span>{{ scope.$index + 1 }}</span>
              </template>
            </el-table-column>
            <el-table-column
              prop="oldfilename"
              label="文件名称"
              align="center"
              min-width="50%"
            >
            </el-table-column>
            <el-table-column
              label="操作"
              align="center"
              class-name="small-padding fixed-width"
              min-width="10%"
            >
              <template slot-scope="scope">
                <span class="span" @click="examine(scope.$index, spxx)"
                  >查看</span
                >
              </template>
            </el-table-column>
          </el-table>
          <!-- </div>
          <h5 class="titlessss" v-else>暂无</h5> -->
          <!-- 高新技术认证 -->
          <div class="title">
            <h6></h6>
            高新技术认证
          </div>

          <el-table
            :data="gxjsrz"
            border
            style="width: 800px"
            stripe
            :header-cell-style="{
              background: '#F1F5FF',
              color: '#4D4D4D',
            }"
          >
            <el-table-column prop="" label="序号" min-width="8%" align="center">
              <template slot-scope="scope">
                <span>{{ scope.$index + 1 }}</span>
              </template>
            </el-table-column>
            <el-table-column
              prop="oldfilename"
              label="文件名称"
              align="center"
              min-width="50%"
            >
            </el-table-column>
            <el-table-column
              label="操作"
              align="center"
              class-name="small-padding fixed-width"
              min-width="10%"
            >
              <template slot-scope="scope">
                <span class="span" @click="examine(scope.$index, gxjsrz)"
                  >查看</span
                >
              </template>
            </el-table-column>
          </el-table>
          <!-- </div>
          <h5 class="titlessss" v-else>暂无</h5> -->
          <!-- 体系认证信息 -->
          <div class="title">
            <h6></h6>
            体系认证信息
          </div>

          <el-table
            :data="txrzxx"
            border
            style="width: 800px"
            stripe
            :header-cell-style="{
              background: '#F1F5FF',
              color: '#4D4D4D',
            }"
          >
            <el-table-column prop="" label="序号" min-width="8%" align="center">
              <template slot-scope="scope">
                <span>{{ scope.$index + 1 }}</span>
              </template>
            </el-table-column>
            <el-table-column
              prop="oldfilename"
              label="文件名称"
              align="center"
              min-width="50%"
            >
            </el-table-column>
            <el-table-column
              label="操作"
              align="center"
              class-name="small-padding fixed-width"
              min-width="10%"
            >
              <template slot-scope="scope">
                <span class="span" @click="examine(scope.$index, txrzxx)"
                  >查看</span
                >
              </template>
            </el-table-column>
          </el-table>
          <!-- </div>
          <h5 class="titlessss" v-else>暂无</h5> -->
          <!-- 外贸产品认证信息 -->
          <div class="title">
            <h6></h6>
            产品认证信息
          </div>
          <el-table
            :data="wmcprzxx"
            border
            style="width: 800px"
            stripe
            :header-cell-style="{
              background: '#F1F5FF',
              color: '#4D4D4D',
            }"
          >
            <el-table-column prop="" label="序号" min-width="8%" align="center">
              <template slot-scope="scope">
                <span>{{ scope.$index + 1 }}</span>
              </template>
            </el-table-column>
            <el-table-column
              prop="oldfilename"
              label="文件名称"
              align="center"
              min-width="50%"
            >
            </el-table-column>
            <el-table-column
              label="操作"
              align="center"
              class-name="small-padding fixed-width"
              min-width="10%"
            >
              <template slot-scope="scope">
                <span class="span" @click="examine(scope.$index, wmcprzxx)"
                  >查看</span
                >
              </template>
            </el-table-column>
          </el-table>
          <!-- </div>
          <h5 class="titlessss" v-else>暂无</h5> -->
          <!-- 进出口资质信息 -->
          <div class="title">
            <h6></h6>
            进出口资质信息
          </div>
          <!-- <div class="license1" style="">
            <el-upload
              multiple
              action="#"
              class="upload-demo"
              :auto-upload="false"
              :on-change="handleChangeBusinessJckzzxx"
              :http-request="uploadFileBusiness"
              :file-list="fileListJckzzxxList"
              :limit="limit"
              list-type="picture"
            >
              <el-button size="small" type="primary">点击上传</el-button>
              <div slot="tip" class="el-upload__tip">
                （1.上传文件大小不超过5M；2.支持上传多个文件）
              </div>
            </el-upload>
          </div> -->
          <!-- <div v-if="jckzzxx"> -->
          <el-table
            :data="jckzzxx"
            border
            style="width: 800px"
            stripe
            :header-cell-style="{
              background: '#F1F5FF',
              color: '#4D4D4D',
            }"
          >
            <el-table-column prop="" label="序号" min-width="8%" align="center">
              <template slot-scope="scope">
                <span>{{ scope.$index + 1 }}</span>
              </template>
            </el-table-column>
            <el-table-column
              prop="oldfilename"
              label="文件名称"
              align="center"
              min-width="50%"
            >
            </el-table-column>
            <el-table-column
              label="操作"
              align="center"
              class-name="small-padding fixed-width"
              min-width="10%"
            >
              <template slot-scope="scope">
                <span class="span" @click="examine(scope.$index, jckzzxx)"
                  >查看</span
                >
              </template>
            </el-table-column>
          </el-table>
          <!-- </div>
          <h5 class="titlessss" v-else>暂无</h5> -->
          <!-- 荣誉信息 -->
          <div class="title">
            <h6></h6>
            荣誉信息
          </div>
          <!-- <div class="license1" style="">
            <el-upload
              multiple
              action="#"
              class="upload-demo"
              :auto-upload="false"
              :on-change="handleChangeBusinessRyxx"
              :http-request="uploadFileBusiness"
              :file-list="fileListRyxxList"
              :limit="limit"
              list-type="picture"
            >
              <el-button size="small" type="primary">点击上传</el-button>
              <div slot="tip" class="el-upload__tip">
                （1.上传文件大小不超过5M；2.支持上传多个文件）
              </div>
            </el-upload>
          </div> -->
          <!-- <div v-if="ryxx"> -->
          <el-table
            :data="ryxx"
            border
            style="width: 800px"
            stripe
            :header-cell-style="{
              background: '#F1F5FF',
              color: '#4D4D4D',
            }"
          >
            <el-table-column prop="" label="序号" min-width="8%" align="center">
              <template slot-scope="scope">
                <span>{{ scope.$index + 1 }}</span>
              </template>
            </el-table-column>
            <el-table-column
              prop="oldfilename"
              label="文件名称"
              align="center"
              min-width="50%"
            >
            </el-table-column>
            <el-table-column
              label="操作"
              align="center"
              class-name="small-padding fixed-width"
              min-width="10%"
            >
              <template slot-scope="scope">
                <span class="span" @click="examine(scope.$index, ryxx)"
                  >查看</span
                >
              </template>
            </el-table-column>
          </el-table>
          <!-- </div> -->
          <!-- <h5 class="titlessss" v-else>暂无</h5> -->
          <!-- 审计报告或者财务报表 -->
          <div class="title">
            <h6></h6>
            财务信息
          </div>
          <!-- <div v-if="sjbg_cwbb"> -->
          <el-table
            :data="sjbg_cwbb"
            border
            style="width: 800px"
            stripe
            :header-cell-style="{
              background: '#F1F5FF',
              color: '#4D4D4D',
            }"
          >
            <el-table-column prop="" label="序号" min-width="8%" align="center">
              <template slot-scope="scope">
                <span>{{ scope.$index + 1 }}</span>
              </template>
            </el-table-column>
            <el-table-column
              prop="oldfilename"
              label="文件名称"
              align="center"
              min-width="50%"
            >
            </el-table-column>
            <el-table-column
              label="操作"
              align="center"
              class-name="small-padding fixed-width"
              min-width="10%"
            >
              <template slot-scope="scope">
                <span class="span" @click="examine(scope.$index, sjbg_cwbb)"
                  >查看</span
                >
              </template>
            </el-table-column>
          </el-table>
          <!-- </div> -->
          <!-- <h5 class="titlessss" v-else>暂无</h5> -->
          <!-- 征信报告 -->
          <div class="title">
            <h6></h6>
            征信报告
          </div>
          <!-- <div v-if="yhzxbg"> -->
          <el-table
            :data="yhzxbg"
            border
            style="width: 800px"
            stripe
            :header-cell-style="{
              background: '#F1F5FF',
              color: '#4D4D4D',
            }"
          >
            <el-table-column prop="" label="序号" min-width="8%" align="center">
              <template slot-scope="scope">
                <span>{{ scope.$index + 1 }}</span>
              </template>
            </el-table-column>
            <el-table-column
              prop="oldfilename"
              label="文件名称"
              align="center"
              min-width="50%"
            >
            </el-table-column>
            <el-table-column
              label="操作"
              align="center"
              class-name="small-padding fixed-width"
              min-width="10%"
            >
              <template slot-scope="scope">
                <span class="span" @click="examine(scope.$index, yhzxbg)"
                  >查看</span
                >
              </template>
            </el-table-column>
          </el-table>
          <!-- </div> -->
          <!-- <h5 class="titlessss" v-else>暂无</h5> -->
          <div class="title">
            <h6></h6>
            守信红名单
          </div>
          <!-- 表单 -->
          <el-form
            :model="ruleForm"
            ref="ruleForm"
            label-width="180px"
            class="demo-ruleForm"
          >
            <el-form-item label="是否列入守信红名单">
              <el-radio-group disabled v-model="ruleForm.promisesred">
                <el-radio label="是" value="true"></el-radio>
                <el-radio label="否" value="false"></el-radio>
              </el-radio-group>
            </el-form-item>
          </el-form>
          <!-- 证明文件 -->
          <div
            class="license"
            style="margin-top: 35px; margin-left: 40px"
            v-if="ruleForm.promisesred == '是'"
          >
            <div class="titles" style="width: 140px">证明文件</div>
            <h5
              style="width: 240px; height: 150px; margin-right: 8px"
              v-viewer
              v-if="zmwj"
            >
              <img :src="zmwj" alt="" style="width: 100%; height: 100%" />
            </h5>
            <h5 class="titles" v-else>暂无</h5>
          </div>
          <template v-if="type == 1 || type == 4">
            <div class="title">
              <h6></h6>
              海关信用认定
            </div>
            <!-- 表单 -->
            <el-form
              :model="ruleForm"
              ref="ruleForm"
              label-width="180px"
              class="demo-ruleForm"
            >
              <el-form-item label="是否有海关信用认证">
                <el-radio-group disabled v-model="ruleForm.customsauth">
                  <el-radio label="是" value="true"></el-radio>
                  <el-radio label="否" value="false"></el-radio>
                </el-radio-group>
              </el-form-item>
              <el-form-item
                label="海关信用认定等级"
                v-if="ruleForm.customsauth == '是'"
              >
                <el-input
                  disabled
                  v-model="ruleForm.customsauthgrade"
                ></el-input>
              </el-form-item>
            </el-form>
            <!-- 认定证书 -->
            <div
              class="license"
              style="margin-top: 35px; margin-left: 40px"
              v-if="ruleForm.customsauth == '是'"
            >
              <div class="titles" style="width: 140px">认定证书</div>
              <h5
                style="width: 240px; height: 150px; margin-right: 8px"
                v-viewer
                v-if="rdzs"
              >
                <img :src="rdzs" alt="" style="width: 100%; height: 100%" />
              </h5>
              <h5 class="titles" v-else>暂无</h5>
            </div>
          </template>
        </div>

        <div class="btn">
          <button class="last" @click="lastStep">上一步</button>
          <button class="next" :disabled="isLock" @click="nextStep">
            提交
          </button>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import { info, files, del, commit } from "@/api/authentication/index.js";
import axios from "axios";
import Cookies from "js-cookie";
import { baseURL } from "@/utils/http";
export default {
  data() {
    return {
      loading: false,
      list: [
        {
          num: "01",
          str: "基本信息",
        },
        {
          num: "02",
          str: "资质信息",
        },
        {
          num: "03",
          str: "财务信息",
        },
        {
          num: "04",
          str: "信用信息",
        },
        {
          num: "05",
          str: "授权信息采集",
        },
        {
          num: "06",
          str: "预览并提交",
        },
      ],
      // 文件上传
      fileListBusiness: [], //证件文件
      fileListZlxx: null, //专利信息
      fileListZlxxList: [],
      fileListSbxx: null, //商标信息
      fileListSbxxList: [],
      fileListGxjsrz: null, //高新技术认证
      fileListGxjsrzList: [],
      fileListTxrzxx: null, //体系认证信息
      fileListTxrzxxList: [],
      fileListWmcprz: null, //外贸产品认证信息
      fileListWmcprzList: [],
      fileListJckzzxx: null, //进出口资质信息
      fileListJckzzxxList: [],
      fileListRyxx: null, //荣誉信息
      fileListRyxxList: [],
      limit: 99,
      // 1111111111111111111111111111111111111111111111111111111
      isLock: false,
      type: "",
      rzid: "",
      yyzz: null, // 营业执照
      qytb: null, // 企业图标
      zzjgt: null, // 组织架构图
      bghjzp: null, // 办公环境照片
      frzm: null, // 身份证正面
      frfm: null, // 身份证反面
      zjwj: null, // 证书文件
      zlxx: null, // 专利信息
      spxx: null, // 商标信息
      gxjsrz: null, // 高新技术认证
      txrzxx: null, // 体系认证信息
      wmcprzxx: null, // 外贸产品认证信息
      jckzzxx: null, // 进出口资质信息
      ryxx: null, // 荣誉信息
      sjbg_cwbb: null, // 审计报告或者财务报表
      yhzxbg: null, // 银行征信报告
      zmwj: null, // 证明文件
      rdzs: null, // 认定证书

      ruleForm: {
        entname: "", //企业名称
        creditno: "", //统一信用代码
        prov: "", //注册省份
        realcapital: "", //实缴资本
        introduction: "", //公司介绍
        legalname: "", //法定代表人姓名
        legalphone: "", //法定代表人手机号
        legalcredentialtype: "", //法定代表人证件类型
        legalcredentialnumber: "", //法定代表人证件号码
        adminlicense: "", //是否有相关行政许可
        adminlicensename: "", //行政许可名称
        adminlicensenumber: "", //行政许可决定书文编号
        effectiveuntil: "", //有效起至
        promisesred: "", //是否列入守信红名单
        customsauth: "", //是否有海关信息认证
        customsauthgrade: "", //海关信用认定等级
        unit: "人民币",
      },
    };
  },
  // 过滤器
  filters: {
    getArea: function (value) {
      value = parseFloat(value);
      if (value == 0) return "-";
      if (!value) return "-";
      // 将数值截取，保留两位小数
      value = value.toFixed(2);
      // 获取整数部分
      const intPart = Math.trunc(value);
      // 整数部分处理，增加,
      const intPartFormat = intPart
        .toString()
        .replace(/(\d)(?=(?:\d{3})+$)/g, "$1,");
      // 预定义小数部分
      let floatPart = ".00";
      // 将数值截取为小数部分和整数部分
      const valueArray = value.toString().split(".");
      if (valueArray.length === 2) {
        // 有小数部分
        floatPart = valueArray[1].toString(); // 取得小数部分
        return intPartFormat + "." + floatPart;
      }
      return intPartFormat + floatPart;
    },
  },
  mounted() {
    document.documentElement.scrollTop = 0;
    this.rzid = sessionStorage.getItem("rzid");
    this.type = localStorage.getItem("type");
    this.getInfo();
    this.getFiles();
  },
  methods: {
    goHome() {
      this.$router.push("/");
    },
    // 表格查看
    examine(index, data) {
      const a = document.createElement("a"); // 动态创建a标签，防止下载大文件时，用户没看到下载提示连续点击
      a.setAttribute("target", "_blank");
      a.href = data[index].filepath;
      a.click();
    },
    // // 表格删除
    // del(index, data) {
    //   let objecttype = data[index].objecttype;
    //   let id = data[index].id;
    //   del(id).then((res) => {
    //     if (res.msg == "操作成功") {
    //       this.$Message.success("删除成功");
    //       this.getFiles();
    //       if (data.length !== 1) return;
    //       if (objecttype == "ZLXX") {
    //         this.zlxx = [];
    //       } else if (objecttype == "SBXX") {
    //         this.spxx = [];
    //       } else if (objecttype == "GXJSRZ") {
    //         this.gxjsrz = [];
    //       } else if (objecttype == "TXRZ") {
    //         this.txrzxx = [];
    //       } else if (objecttype == "WMCPRZ") {
    //         this.wmcprzxx = [];
    //       } else if (objecttype == "JCKZZ") {
    //         this.jckzzxx = [];
    //       } else if (objecttype == "RYXX") {
    //         this.ryxx = [];
    //       } else if (objecttype == "CWXX") {
    //         this.sjbg_cwbb = [];
    //       } else if (objecttype == "YHZXBG") {
    //         this.yhzxbg = [];
    //       }
    //     }
    //   });
    // },
    // 获取信息
    getInfo() {
      let rzid = this.rzid;
      if (rzid == "") return;
      info(this.rzid).then((res) => {
        if (res.msg == "操作成功") {
          if (!res.data) return;
          this.ruleForm = res.data;
          if (!res.data.unit) {
            this.ruleForm.unit = "人民币";
          }
        }
      });
    },
    // 获取文件
    getFiles() {
      let rzid = this.rzid;
      if (rzid == "") return;
      this.loading = true;
      files(this.rzid).then((res) => {
        let bghjzp = [];
        let zlxx = []; //专利信息
        let spxx = []; // 商标信息
        let gxjsrz = []; // 高新技术认证
        let txrzxx = []; // 体系认证信息
        let wmcprzxx = []; // 外贸产品认证信息
        let jckzzxx = []; // 进出口资质信息
        let ryxx = []; // 荣誉信息
        let sjbg_cwbb = []; // 审计报告或者财务报表
        let yhzxbg = []; // 银行征信报告
        if (res.msg == "操作成功") {
          let data = res.data;
          for (let i = 0; i < data.length; i++) {
            if (data[i].objecttype == "YYZZ") {
              this.yyzz = data[i].filepath;
            } else if (data[i].objecttype == "LOGO") {
              this.qytb = data[i].filepath;
            } else if (data[i].objecttype == "ZZJGT") {
              this.zzjgt = data[i].filepath;
            } else if (data[i].objecttype == "BGHJ") {
              bghjzp.push(data[i].filepath);
              this.bghjzp = bghjzp;
            } else if (data[i].objecttype == "SFZZ") {
              this.frzm = data[i].filepath;
            } else if (data[i].objecttype == "SFZF") {
              this.frfm = data[i].filepath;
            } else if (data[i].objecttype == "YWXGXZXKZS") {
              this.zjwj = data[i].filepath;
            } else if (data[i].objecttype == "ZLXX") {
              zlxx.push(data[i]);
              this.zlxx = zlxx;
            } else if (data[i].objecttype == "SBXX") {
              spxx.push(data[i]);
              this.spxx = spxx;
            } else if (data[i].objecttype == "GXJSRZ") {
              gxjsrz.push(data[i]);
              this.gxjsrz = gxjsrz;
            } else if (data[i].objecttype == "TXRZ") {
              txrzxx.push(data[i]);
              this.txrzxx = txrzxx;
            } else if (data[i].objecttype == "WMCPRZ") {
              wmcprzxx.push(data[i]);
              this.wmcprzxx = wmcprzxx;
            } else if (data[i].objecttype == "JCKZZ") {
              jckzzxx.push(data[i]);
              this.jckzzxx = jckzzxx;
            } else if (data[i].objecttype == "RYXX") {
              ryxx.push(data[i]);
              this.ryxx = ryxx;
            } else if (data[i].objecttype == "CWXX") {
              sjbg_cwbb.push(data[i]);
              this.sjbg_cwbb = sjbg_cwbb;
            } else if (data[i].objecttype == "YHZXBG") {
              yhzxbg.push(data[i]);
              this.yhzxbg = yhzxbg;
            } else if (data[i].objecttype == "SXHMD") {
              this.zmwj = data[i].filepath;
            } else if (data[i].objecttype == "HGXXRD") {
              this.rdzs = data[i].filepath;
            }
          }
          this.loading = false;
        }
      });
    },

    lastStep() {
      this.$router.go(-1);
    },
    nextStep() {
      this.isLock = true;
      setTimeout(() => {
        this.isLock = false;
      }, 10000);
      let id = this.rzid;
      commit(id).then((res) => {
        if (res.msg == "操作成功") {
          this.$router.push("/flow8");
        }
      });
    },
    // 文件上传
    //自定义上传文件
    uploadFileBusiness(file) {
      return;
    },
    // // 专利信息
    // handleChangeBusinessZlxx(file, fileList) {
    //   // 上传
    //   // 调用接口
    //   let token = localStorage.getItem("token");
    //   let formData = new FormData();
    //   for (let i = 0; i < fileList.length; i++) {
    //     formData.append("patents", fileList[i].raw);
    //   }
    //   let url = baseURL + `/auth/manage/addZLXX?entrzId=${this.rzid}`;
    //   axios
    //     .post(url, formData, {
    //       headers: { "Content-Type": "multipart/form-data", "x-auth": token },
    //     })
    //     .then((res) => {});
    // },
    //------------------------------------------------------
    // 商标信息
    handleChangeBusinessSbxx(file, fileList) {
      this.fileListSbxxList.push(file);
      // this.fileListSbxx = this.fileListSbxxList;
      this.spxx.push(...this.fileListSbxxList);
    },
    //------------------------------------------------------
    // 高新技术认证
    handleChangeBusinessGxjsrz(file, fileList) {
      // if (!this.status) {
      //   this.$Message.warning(`数据缓存中，缓存倒计时 ${this.figure} 秒`);
      //   return;
      // }
      this.fileListGxjsrzList.push(file);
      // this.fileListGxjsrz = this.fileListGxjsrzList;
      this.gxjsrz.push(...this.fileListGxjsrzList);
    },

    //------------------------------------------------------
    // 体系认证信息
    handleChangeBusinessTxrzxx(file, fileList) {
      // if (!this.status) {
      //   this.$Message.warning(`数据缓存中，缓存倒计时 ${this.figure} 秒`);
      //   return;
      // }
      this.fileListTxrzxxList.push(file);
      // this.fileListTxrzxx = this.fileListTxrzxxList;
      this.txrzxx.push(...fileListTxrzxxList);
    },

    //------------------------------------------------------
    // 外贸产品认证信息
    handleChangeBusinessWmcprz(file, fileList) {
      // if (!this.status) {
      //   this.$Message.warning(`数据缓存中，缓存倒计时 ${this.figure} 秒`);
      //   return;
      // }
      this.fileListWmcprzList.push(file);
      // this.fileListWmcprz = this.fileListWmcprzList;
      this.wmcprzxx.push(...fileListWmcprzList);
    },
    //------------------------------------------------------
    // 进出口资质信息
    handleChangeBusinessJckzzxx(file, fileList) {
      // if (!this.status) {
      //   this.$Message.warning(`数据缓存中，缓存倒计时 ${this.figure} 秒`);
      //   return;
      // }
      this.fileListJckzzxxList.push(file);
      // this.fileListJckzzxx = this.fileListJckzzxxList;
      this.jckzzxx.push(...fileListJckzzxxList);
    },
    // 荣誉信息
    handleChangeBusinessRyxx(file, fileList) {
      // if (!this.status) {
      //   this.$Message.warning(`数据缓存中，缓存倒计时 ${this.figure} 秒`);
      //   return;
      // }
      this.fileListRyxxList.push(file);
      // this.fileListRyxx = this.fileListRyxxList;
      this.ryxx.push(...fileListRyxxList);
    },
  },
};
</script>

<style lang="scss" scoped>
ul {
  list-style: none;
}
.box {
  position: relative;
  width: 100%;
  box-sizing: border-box;
  padding-bottom: 80px;
  background: #f5f7fa;
  .f1 {
    width: 100%;
    height: 138px;
    background: #f0f1f7;
    .f1_content {
      position: relative;
      margin: 0 auto;
      width: 1200px;
      height: 100%;
      .goHome {
        display: flex;
        align-items: center;
        height: 25px;
        cursor: pointer;
        z-index: 9999;
        position: absolute;
        right: 10px;
        top: 10px;
        font-size: 16px;
        font-weight: 500;
        color: #616060;
        img {
          width: 24px;
          // height: 24px;
        }
      }
      ul {
        height: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        li {
          h6 {
            font-size: 14px;
            font-weight: 400;
            color: #515151;
            margin-bottom: 5px;
            span {
              font-size: 22px;
              font-family: Britannic Bold;
              font-weight: 500;
              color: #000000;
            }
          }
          .quan {
            width: 24px;
            height: 24px;
          }
          .line {
            width: 123px;
            height: 3px;
          }
        }
      }
    }
  }
  .f2 {
    margin: 0 auto;
    padding: 20px 80px 0 80px;
    width: 1200px;
    background-color: #fff;
    .content {
      box-sizing: border-box;
      padding: 0px 20px 50px 50px;
      // margin: 0 auto;
      // width: 1520px;
      height: 100%;
      .title {
        display: flex;
        align-items: center;
        box-sizing: border-box;
        font-size: 18px;
        font-weight: bold;
        color: #333333;
        margin: 40px 0;
        h6 {
          width: 5px;
          height: 18px;
          background-color: #0a7be0;
          margin-right: 10px;
        }
      }
      .content1 {
        box-sizing: border-box;
        padding: 15px 45px;
        // height: 666px;
        width: 1060px;
        margin: 45px 0;
        // overflow: auto;
        box-shadow: 0px 2px 7px 10px rgba(175, 173, 173, 0.29);
        border-radius: 8px;
        .license {
          display: flex;
          // width: 100%;
          margin-left: 60px;
          .titles {
            box-sizing: border-box;
            padding-right: 15px;
            font-size: 14px;
            font-weight: 600;
            color: #333333;
            text-align: right;
          }
          .aaa {
            width: 180px;
            font-size: 16px;
            font-family: Source Han Sans SC;
            font-weight: 400;
            color: #999999;
          }
          img {
            width: 250px;
            height: 100%;
          }

          .card {
            width: 216px;
            height: 123px;
            margin-right: 8px;
            img {
              width: 100%;
              height: 100%;
            }
          }
          .license-right {
            display: flex;
            flex-direction: column;
            justify-content: flex-end;
            div {
              width: 100%;
              p {
                font-size: 14px;
                font-family: Source Han Sans SC;
                font-weight: 400;
                color: #999999;
                line-height: 24px;
              }
            }
          }
        }
      }
      // 按钮
      .btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 50px;
        .last {
          width: 160px;
          height: 36px;
          background: #0a7be0;
          opacity: 0.3;
          border-radius: 4px;
        }
        .next {
          width: 160px;
          height: 36px;
          background: #0a7be0;
          border-radius: 4px;
        }
        button {
          font-weight: 600;
          cursor: pointer;
          align-items: center;
          justify-content: center;
          display: flex;
          border-radius: 5px;
          width: 180px;
          height: 50px;
          color: #fff;
          background-color: #24829d;
          margin-left: 30px;
          border: 0;
        }
      }
    }
  }
}
.license1 {
  display: flex;
  margin-bottom: 20px;
  margin-left: 25px;
}
// 操作按钮
.span {
  display: inline-block;
  font-size: 15px;
  font-family: Source Han Sans SC;
  font-weight: 400;
  margin-right: 5px;
  color: #0a7be0;
  border-bottom: 1px solid #0a7be0;
  cursor: pointer;
}
.span1 {
  margin-right: 0;
  color: #ff4040;
  border-bottom: 1px solid #ff4040;
}
::v-deep .el-select .el-input input {
  width: 100px;
}
//
::v-deep .el-form-item__label {
  font-size: 14px;
  font-weight: 600;
  color: #333333;
}
::v-deep .el-form-item {
  margin-bottom: 22px;
}
/* 输入框样式  */
::v-deep .el-input__inner {
  font-size: 12px;
  box-sizing: border-box;
  width: 500px;

  height: 40px;
  font-size: 015px;
  border: 1px solid #e0e0e0;
  border-radius: 0px;
  padding: 10px 10px;
  color: #606266;
  outline: 0;
  line-height: 35px !important;
}
::v-deep .el-textarea .el-textarea__inner {
  box-sizing: border-box;
  width: 500px;
  // height: 0.2031px;
  font-size: 15px;
  border: 1px solid #e0e0e0;
  border-radius: 0px;
  padding: 0px 10px;
  color: #606266;
  outline: 0;
  font-weight: 500;
  line-height: 35px !important;
}
::v-deep .aaaa .el-input__inner {
  width: 355px;
}
// 文件上传
::v-deep .el-upload-list--picture .el-upload-list__item-thumbnail {
  width: 140px;
}

::v-deep .el-upload-list--picture .el-upload-list__item-name {
  display: none;
}

::v-deep .upload-demo .el-upload-list {
  display: none;
}

::v-deep .upload-demo {
  display: flex;
}

::v-deep .el-upload__tip {
  margin-left: 15px;
}

::v-deep .el-upload-list--picture .el-upload-list__item {
  width: 180px;
  margin-right: 15px;
}
::v-deep .el-input {
  font-size: 15px;
}
::v-deep .el-textarea__inner {
  &::placeholder {
    font-size: 14em;
    @media only screen and (min-width: 0px) and (max-width: 530px) {
      font-size: 12px;
    }
    font-family: "Microsoft YaHei";
  }
  @media only screen and (min-width: 0px) and (max-width: 599px) {
    padding: 0 5px;
  }
  color: #555;
  font-family: "Microsoft YaHei";
  font-size: 15px !important;
}
::v-deep .el-input__inner {
  &::placeholder {
    font-size: 14px;
    @media only screen and (min-width: 0px) and (max-width: 530px) {
      font-size: 12px;
    }
    font-family: "Microsoft YaHei";
  }
  @media only screen and (min-width: 0px) and (max-width: 599px) {
    padding: 0 5px;
    height: 35px;
  }
  color: #555;
  font-family: "Microsoft YaHei";
  font-size: 15px !important;
}
::v-deep .el-table {
  font-size: 14px;
}
</style>
